package fr.ginvest.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "demande_angel_club")
public class DemandeAngelClub extends Demande implements Serializable {

	private static final long serialVersionUID = -6922843855081902412L;
	
	public enum Objet{JOINDRE,QUITTER}
	
	@ManyToOne
	@JoinColumn(name="origine_angel",referencedColumnName="id", nullable=false)
	private Angel origine;
	
	@ManyToOne
	@JoinColumn(name="destination_club",referencedColumnName="id", nullable=false)
	private Club destination;
	
	@Enumerated(EnumType.STRING)
	@Column(length=7, nullable=false)
	private Objet objet;
	
	public DemandeAngelClub() {}

	public DemandeAngelClub(Angel origine, Club destination, Objet objet,
			String message) {
		super(message);
		this.origine = origine;
		this.destination = destination;
		this.objet = objet;
	}
	

	public Angel getOrigine() {
		return origine;
	}

	public Club getDestination() {
		return destination;
	}

	public Objet getObjet() {
		return objet;
	}
	public void setObjet(Objet objet) {
		this.objet = objet;
	}	
}
